package edu.zqxy.eastmoney.service.impl;

import edu.zqxy.eastmoney.mapper.KlineMapper;
import edu.zqxy.eastmoney.pojo.Kline;
import edu.zqxy.eastmoney.pojo.Stock;
import edu.zqxy.eastmoney.service.IKlineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class KlineServiceImpl implements IKlineService{
    @Autowired
    KlineMapper klineMapper;//...
    @Override
    public int save(Kline entity) {
        return klineMapper.insert(entity);
    }

    @Override
    public int update(Kline entity)
    {
        return klineMapper.updateByPrimaryKey(entity);
    }

    @Override
    public int delete(Object id)
    {
        return klineMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Kline findById(Object id)
    {
        return klineMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Kline> findAll()
    {
        return klineMapper.selectAll();
    }
}
